package com.ellricky.baselib.adapter.xufei;

import android.app.Activity;
import android.widget.ImageView;

import com.andr.common.ui.adapter.BaseRecyclerAdapter;
import com.andr.common.ui.adapter.SmartViewHolder;
import com.andr.common.util.EmptyUtil;
import com.ellricky.baselib.R;
import com.ellricky.baselib.entity.xufei.PayUploadEntity;
import com.ellricky.baselib.util.GlideUtil;

public class PayUploadAdapter extends BaseRecyclerAdapter<PayUploadEntity> {

    private Activity context;

    public PayUploadAdapter(Activity context) {
        super(R.layout.base_adapter_pay_upload);
        this.context = context;
    }

    @Override
    protected void onBindViewHolder(SmartViewHolder vh, PayUploadEntity p1, int i) {
        ImageView iv = vh.itemView.findViewById(R.id.ivPic);

        String url = p1.getImageUrl();
        if (EmptyUtil.isEmpty(url)) {
            iv.setImageResource(R.drawable.base_icon_upload_add);
        } else {
            GlideUtil.into(context, url, iv);
        }

    }
}
